package com.mkh.st.admin.feign;

import com.mkh.st.admin.api.entity.StFinancialSet;
import com.mkh.st.admin.api.feign.ISysBusinessEntityProvider;
import com.mkh.st.admin.api.vo.SiteInfoVO;
import com.mkh.st.admin.api.vo.SysBusinessSetVO;
import com.mkh.st.admin.service.StFinancialSetService;
import com.mkh.st.admin.service.SysBusinessEntityService;
import com.mkh.st.admin.service.SysBusinessSetService;
import com.mkh.st.common.core.util.R;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@AllArgsConstructor
public class SysBusinessEntityProvider implements ISysBusinessEntityProvider {

	private final SysBusinessEntityService sysBusinessEntityService;

	private final SysBusinessSetService businessSetService;

	private final StFinancialSetService financialSetService;

	@Override
	@GetMapping("/site/provider/getSiteInfo")
	public R<List<SiteInfoVO>> getSiteInfo(@RequestParam("menuCode") String menuCode) {
		return R.ok(sysBusinessEntityService.getSiteInfo(menuCode));
	}

    @Override
	@GetMapping("/site/provider/getSiteInfoById")
    public R<SiteInfoVO> getSiteInfoById(@RequestParam("siteId") Long siteId) {
        return R.ok(sysBusinessEntityService.getSiteInfoById(siteId));
    }

    @Override
    public R<SysBusinessSetVO> getSysBusinessSet(Long siteId) {
        return R.ok(businessSetService.getBusnessSet(siteId));
    }

	@Override
	public R<StFinancialSet> getStFinancialSet() {
		return R.ok(financialSetService.getFinancialSet());
	}
}
